" 插件安装
" 需要使用Scoop(或chcoc)全局安装 fzf, ripgrep, bat, fd

call plug#begin('~/.vim/plugged')
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'npm ci'} " 语法提示
Plug 'Exafunction/codeium.vim'
Plug 'madox2/vim-ai', { 'on': ['AI', 'AIChat', 'AIEdit'] }
" Plug 'FittenTech/fittencode.vim'
Plug 'gelguy/wilder.nvim'
Plug 'junegunn/fzf', { 'do': ' -> fzf#install()'}
Plug 'junegunn/fzf.vim'
Plug 'antoinemadec/coc-fzf'
Plug 'liuchengxu/vista.vim', { 'on': 'Vista'}
let g:vista_default_executive = 'coc'
Plug 'skywind3000/asynctasks.vim', { 'on': 'AsyncTask' } " 任务
Plug 'skywind3000/asyncrun.vim', { 'on': 'AsyncRun'}
Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } " 显示leader快捷键
Plug 'junegunn/vim-easy-align' " 代码对齐
Plug 'tpope/vim-fugitive' " git插件
Plug 'mhinz/vim-signify' " git操作标记
Plug 'junegunn/gv.vim', { 'on': 'GV' }
Plug 'rbong/vim-flog', { 'on': 'Flog' }
" 状态栏显示, buffer快捷导航
Plug 'itchyny/lightline.vim' | Plug 'josa42/vim-lightline-coc' | Plug 'mgee/lightline-bufferline' | Plug 'itchyny/vim-gitbranch'
Plug 'rmolin88/pomodoro.vim', { 'on': 'PomodoroStart' } " 番茄时钟
Plug 'haya14busa/incsearch.vim' " 增强/文字搜索
Plug 'sickill/vim-pasta'
Plug 'konfekt/fastfold' " 性能更好的语法折叠
Plug 'terryma/vim-expand-region' " 扩大缩小选择区域
Plug 'ryanoasis/vim-devicons' " 显示文件图标
Plug 'easymotion/vim-easymotion' " 快捷导航单词
" Plug 'justinmk/vim-sneak'
Plug 'machakann/vim-sandwich' " 匹配符号快捷操作
" 多光标
Plug 'mg979/vim-visual-multi'
Plug 'terryma/vim-multiple-cursors'
" 主题
Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' } | Plug 'sainnhe/sonokai' | Plug 'artanikin/vim-synthwave84' | Plug 'bluz71/vim-nightfly-guicolors'
" 操作与编辑
Plug 'matze/vim-move' " 代码块移动 [n]Alt + J/K
Plug 'alvan/vim-closetag' " 自动闭合标签
Plug 'luochen1990/rainbow' " 彩虹符号匹配
Plug 'junegunn/vim-peekaboo' " 查看历史的复制和删除的寄存器, @或\"\" 触发
Plug 'tpope/vim-eunuch', { 'on': ['Delete', 'Mkdir', 'Rename'] } " 加强的目录和文件编辑
Plug 'tpope/vim-repeat' "重复命令操作
Plug 'wakatime/vim-wakatime' " 代码记录
Plug 'ntpeters/vim-better-whitespace' " 显示多余空格
Plug 'ThePrimeagen/vim-be-good', { 'on': 'VimBeGood'}
Plug 'mhinz/vim-startify' " 启动界面预览
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-commentary' " 快捷代码注释
Plug 'brooth/far.vim', { 'on': ['Far', 'Fardo', 'Farf']} " 全局替换搜索
Plug 'yardnsm/vim-import-cost', { 'do': 'npm install', 'on': 'ImportCost' }
Plug 'godlygeek/tabular', { 'on': 'Tabularize' } " 文本对齐
Plug 'asins/vimcdoc' " 中文文档计划
" 专注阅读
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
Plug 'mzlogin/vim-markdown-toc', { 'for': 'markdown' }
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vimwiki'], 'on': 'MarkdownPreview'}
Plug 'junegunn/goyo.vim', { 'on': 'Goyo', 'for': 'markdown' }
Plug 'junegunn/limelight.vim', { 'for': 'markdown' }
Plug 'hotoo/pangu.vim', { 'for': 'markdown'}
Plug 'uguu-org/vim-matrix-screensaver', { 'on': 'Matrix' } " 黑客帝国的屏保
Plug 'tpope/vim-apathy' " 加强版的 go to file
Plug 'chrisbra/NrrwRgn', { 'on': 'NR' } " 专注于选定区域，而使其余区域无法访问,选择区域后:NR
let g:nrrw_rgn_nomap_nr = 1
let g:nrrw_rgn_nomap_Nr = 1
Plug 'sheerun/vim-polyglot'
Plug 'metakirby5/codi.vim', { 'on': ['Codi', 'CodiNew'] }
" Plug 'jaxbot/semantic-highlight.vim'
 " To use Python remote plugin features in Vim, can be skipped
" Plug 'roxma/nvim-yarp'

call plug#end()

" autocmd VimEnter * PlugClean! | PlugUpdate --sync

filetype plugin indent on  " 根据侦测到的不同类型加载对应的插件
nnoremap <leader><leader>i :PlugInstall<cr>
nnoremap <leader><leader>u :PlugUpdate<cr>
nnoremap <leader><leader>c :PlugClean<cr>

" 加载插件配置
for f in split(glob('$VIMPATH/vim/plugins/*.vim'), '\n')
    exe 'source' f
endfor
